home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-13 / amac44a.zip / MIS001.QM < prev    next >
Text File  |  1992-06-22  |  19KB  |  465 lines

  1. *                               mis001.qm
  2. *             Miscellaneous Cursor and Line Position Macros
  3. *                        Written By Tom Hogshead
  4. *                       [ See MISCxx.QM For Use ]
  5. *                                 6/20/92
  6. *  Key    Subfile              Description
  7. * =====  =========      =================================================
  8. *  ^F5_                 Del Chars To Begin of Line, Plus White Space      |chg
  9. *  ^F6_                 Del Chars To Begin of Line, But Not White Space
  10. *
  11. *                       Copy Current or Blocked Lines
  12. *  ^e                    ├─ From Previous To Current Window
  13. *  ^x                    └─ From Current to Next Window
  14. *
  15. *  @9                   Find Word At Cursor In File Below
  16. *  @8                   Move To First Word Delimiter After WordLeft
  17. *  @7                   Move To First Word Delimiter After WordRight
  18. *  @6                   Move To FirstNonWhite Character After WordLeft
  19. *  @5                   Move To FirstNonWhite Character After WordRight
  20. *  ^a_                  Move To First Character Of Wordleft
  21. *  ^f_                  Move To First Character Of Wordright
  22. *  @4                   WordLeft  To FirstNonWhite Character Of Word
  23. *  @3                   WordRight To FirstNonWhite Character Of Word
  24. *  @2                   WordLeft  Not Stop at End of Line
  25. *  @1                   WordRight Not Stop at End of Line
  26. *  @j                   Join Lines with Single Space at Join Point
  27. *  ^F7_                 Align Current Line In Designated Column
  28. *  ^F8_                 Split Line with Split Word In Same Column
  29. *  ^F9_                 Split Line with Split Word In Designated Column
  30. *
  31. *  ^w_                  Scroll UP   Cursor Bar Stays Fixed
  32. *  ^z_                  Scroll DOWN Cursor Bar Stays Fixed
  33. *  @w                   Scroll UP   Two Windows In Sync
  34. *  @z                   Scroll DOWN Two Windows In Sync
  35. *
  36. *  @PgUp                Page Up   By Paragraphs, Modified "Page Up"
  37. *  @PgDn                Page Down By Paragraphs, Modified "Page Dn"
  38. *
  39. *  #F4__                Position Cursor In Column At Top of Paragraph
  40. *  #F5__                Position Cursor In Column At Top of Paragraph
  41. *  #F6__                Position Cursor In Column At Bottom of Paragraph
  42. *
  43. *  #F5   {e:\up\rfr002} Move Cursor First Letter of Word at Cursor
  44. *  #F8   {e:\up\rfr002} Short version of #F5
  45. *  #F7   {e:\up\rfr002} Move Cursor to First Non-White Character of Line
  46. *
  47. *         {e:\up\MISC*} Return To MISCxx.QM
  48. *
  49. *-- eoi
  50.  
  51. *             M A C R O S - Some macros require v2.15
  52. * ------------------------------------------
  53. * @(1) WordRight Not Stop at End of Line
  54. * ------------------------------------------
  55. @1     macrobegin wordright isendline jfalse END  wordright END:
  56. * 10 bytes Mon  10-28-1991  14:16:22 (TH @1)
  57.  
  58. * 
  59. * ------------------------------------------
  60. * @(2) WordLeft Not Stop at End of Line
  61. * ------------------------------------------
  62. @2     macrobegin wordleft isendline jfalse END  wordleft END:
  63. * 10 bytes Mon  10-28-1991  14:16:22 (TH @2)
  64.  
  65. * 
  66. * -----------------------------------------------------
  67. * @(3) WordRight To FirstNonWhite Character Of Word
  68. * -----------------------------------------------------
  69. *TEST* ├TEST├   TEST   ▓├TEST├
  70.      * ├TEST├   TEST   ▓├TEST├
  71.  
  72. @3      macrobegin setscreenoff
  73.     10: isendline jfalse 11 cursordown    firstnonwhite        jump END
  74.     11: splitline #173 cursordown begline firstnonwhite        jtrue 12
  75.         cursorup endline cursorleft delch joinline cursorright jump 10
  76.     12: cursorup endline cursorleft delch joinline
  77.     21: splitline #173 cursordown begline firstnonwhite        jfalse 22
  78.         cursorup endline cursorleft delch joinline cursorright jump 21
  79.     22: cursorup endline cursorleft delch joinline
  80.    END:
  81. *
  82. * 69 bytes Tue  01-07-1992  21:19:49 (TH @3, to DK #0/16964, Ver 1)
  83. * 60 bytes Wed  01-08-1992  12:44:06 (TH @3, removed second endline test Ver 2)
  84.  
  85. * 
  86. * -----------------------------------------------------
  87. * @(4) WordLeft To FirstNonWhite Character Of Word
  88. * -----------------------------------------------------
  89. *TEST* ├TEST├   TEST   ▓├TEST├
  90.      * ├TEST├   TEST   ▓├TEST├
  91.  
  92. @4      macrobegin setscreenoff wordleft
  93.     11: splitline #173 cursordown begline firstnonwhite       jtrue 12
  94.         cursorup endline cursorleft delch joinline cursorleft jtrue 11
  95.         jump end
  96.     12: cursorup endline cursorleft delch joinline cursorright
  97.    END:
  98. *
  99. * 33 bytes Wed  01-08-1992  12:48:04 (TH @4 Ver 1)
  100.  
  101. * 
  102. * -----------------------------------------------------
  103. * @(5) Move To FirstNonWhite Character After WordRight
  104. * -------------- Version #1 ---------------------------
  105. *TEST* ├TEST├   TEST   ▓├TEST├
  106.      * ├TEST├   TEST   ▓├TEST├
  107.  
  108. @5      macrobegin setscreenoff wordright
  109.     10: isendline jfalse 11 cursordown    firstnonwhite        jump END
  110.     11: splitline #173 cursordown begline firstnonwhite        jtrue 12
  111.         cursorup endline cursorleft delch joinline cursorright jump 10
  112.     12: cursorup endline cursorleft delch joinline
  113.    END:
  114. *
  115. * 38 bytes Wed  01-08-1992  16:16:48 (TH @5)
  116.  
  117. * 
  118. * -----------------------------------------------------
  119. * @(6) Move To FirstNonWhite Character After WordLeft
  120. * -------------- Version #2 ---------------------------
  121. *TEST* ├TEST├   TEST   ▓├TEST├
  122.      * ├TEST├   TEST   ▓├TEST├
  123.  
  124. @6      macrobegin setscreenoff
  125.         wordleft wordleft isendline jfalse END1  wordleft END1:            *|
  126.     21: splitline #173 cursordown begline firstnonwhite jtrue 22
  127.         isemptyline jtrue 22
  128.         cursorup endline cursorleft delch joinline cursorright jump 21
  129.     22: cursorup endline cursorleft delch joinline
  130.    END:
  131. *
  132. * 38 bytes Wed  01-08-1992  17:25:34 (TH @6)
  133. * 39 bytes Sun  01-12-1992  14:47:07 (TH @6, added second wordleft, Ver 2)
  134.  
  135. * 
  136. * ----------------------------------------------------------------------
  137. * @(7) Move To First Word Delimiter After WordRight
  138. * ----------------------------------------------------------------------
  139. *TEST* ├TEST├   TEST   ▓├TEST├
  140.      * ├TEST├   TEST   ▓├TEST├
  141.  
  142. @7          macrobegin
  143.             wordright endline jtrue NO_EOL
  144.             wordright jump GOTOPOS
  145.  NO_EOL:    prevposition
  146.  GOTOPOS:   markword gotoblockend unmarkblock
  147. *
  148. * 17 bytes Mon  10-22-1990  11:32:32
  149.  
  150. * 
  151. * ----------------------------------------------------------------------
  152. * @(8) Move To First Word Delimiter After WordLeft
  153. * ----------------------------------------------------------------------
  154. *TEST* ├TEST├   TEST   ▓├TEST├
  155.      * ├TEST├   TEST   ▓├TEST├
  156.  
  157. @8          macrobegin
  158.             wordleft wordleft endline jtrue NO_EOL
  159.             wordleft jump GOTOPOS
  160.  NO_EOL:    prevposition
  161.  GOTOPOS:   markword gotoblockend unmarkblock
  162. *
  163. * 18 bytes Mon  10-22-1990  11:32:21
  164.  
  165. * 
  166. * -------------------------------------------
  167. * @(9) Find Word At Cursor In File Below
  168. * -------------------------------------------
  169. @9 macrobegin markword jfalse END copy find paste return "i" return END:
  170. *
  171. * 15 bytes Thu  01-09-1992  08:21:18 (TH @9)
  172.  
  173. * 
  174. * ----------------------------------------------------------------------
  175. * @(j) Join Lines with Single Space at Join Point, by John Goodman
  176. * ----------------------------------------------------------------------
  177. @j      macrobegin
  178.         endline cursorright cursorright joinline cursorleft delrtword
  179. * 10 bytes Fri  07-26-1991  19:30:39 (JG @j in RFRMxx.QM rfr007.qm)
  180.  
  181. * 
  182. * ----------------------------------------------------------------------
  183. * ^(F7_) Align Current Line In Designated Column
  184. * ----------------------------------------------------------------------
  185. ^F7     macrobegin
  186.         begline splitline gotocolumn Pause return
  187.         cursorright joinline cursorleft delrtword
  188. * 13 bytes Fri  11-15-1991  13:01:04 (TH ^F7)
  189.  
  190. * 
  191. * ----------------------------------------------------------------------
  192. * ^(F8_) Split Line with Split Word In Same Column as Current Line
  193. * ----------------------------------------------------------------------
  194. ^F8     macrobegin
  195.         dupline cursorup deltoeol cursordown
  196.         splitline splitline delline joinline
  197. * 12 bytes Fri  11-15-1991  13:02:05 (TH ^F8)
  198.  
  199. * aaa bbb
  200.  
  201. * 
  202. * ----------------------------------------------------------------------
  203. * ^(F9_) Split Line with Split Word In Designated Column
  204. * ----------------------------------------------------------------------
  205. ^F9     macrobegin
  206.         splitline splitline cursordown
  207.         gotocolumn Pause return joinline
  208. * 11 bytes Fri  11-15-1991  11:17:45 (TH ^F9)
  209.  
  210. * aaa bbb
  211.  
  212. * 
  213. * ----------------------------------------------------------------------
  214. * ^(F5_) Delete All Characters To Begin of Line, PLUS White Space
  215. * ----------------------------------------------------------------------
  216. ^F5     macrobegin
  217.         splitline delline begline
  218. * 10 bytes Mon  11-25-1991  09:35:32 (TH ^F5)
  219. * 7 bytes Sat  06-20-1992  12:59:02 (TH ^F5, shortened)
  220.  
  221. * 
  222. * ----------------------------------------------------------------------
  223. * ^(F6_) Delete All Characters To Begin of Line, But Not White Space
  224. * ----------------------------------------------------------------------
  225. ^F6     macrobegin
  226.         splitline delline insertline joinline
  227. * 8 bytes Mon  11-25-1991  09:35:22 (TH ^F6)
  228.  
  229. * 
  230. *---------------------------------------------------
  231. * @(PgUp) Page Up By Paragraphs, Modified "Page Up"
  232. *---------------------------------------------------
  233. * This macro does a modified page UP with the cursor at the top of the
  234. * screen at the beginning of a paragraph, the first paragraph on the
  235. * screen being the last parapgraph which might not have been fully
  236. * visible on the top of previous screen. This is handy for getting to
  237. * and from paragraphs during editing or viewing.
  238.  
  239. 177 MacroBegin PageUp PrevPara BegLine Maketopofscreen
  240. *
  241. * 8 bytes Thu  02-21-1991  14:23:43
  242.  
  243. * 
  244. *-----------------------------------------------------
  245. * @(PgDn)  Page Down By Paragraphs, Modified "Page Dn"
  246. *----------------------------------------------------
  247. * This macro does a modified page DOWN with the cursor at the top of
  248. * the screen on the end of the last paragraph which was not fully
  249. * visible on the previous screen. This is handy for getting to and from
  250. * paragraphs during editing or viewing.
  251.  
  252. 176 MacroBegin PageDown EndPara BegLine Maketopofscreen
  253. *
  254. * 8 bytes Thu  02-21-1991  19:11:14
  255.  
  256. * 
  257. * ----------------------------------------------------------------------
  258. * ^(w_) Scroll Up, Cursor Bar Stays Fixed
  259. * ----------------------------------------------------------------------
  260. ^w lineup
  261. *
  262. * 6 bytes Fri  02-22-1991  17:01:18
  263. * 0 bytes Sat  08-24-1991  16:30:39 (TH ^w)
  264.  
  265. * 
  266. * ----------------------------------------------------------------------
  267. * ^(z_) Scroll Down, Cursor Bar Stays Fixed
  268. * ----------------------------------------------------------------------
  269. ^z linedown
  270. *
  271. * 6 bytes Fri  02-22-1991  17:01:18
  272. * 0 bytes Sat  08-24-1991  16:31:11 (TH ^z)
  273.  
  274. * 
  275. * ----------------------------------------------------------------------
  276. * @(w) Scroll Two Windows Up In Sync
  277. * ----------------------------------------------------------------------
  278. @w macrobegin Lineup nextwindow Lineup prevwindow
  279. *
  280. * 10 bytes Fri  02-22-1991  16:52:31
  281. * 8 bytes Sat  08-24-1991  16:26:08 (TH @w, written by Richard BlackBurn)
  282.  
  283. * 
  284. * ----------------------------------------------------------------------
  285. * @(z) Scroll Two Windows Down In Sync
  286. * ----------------------------------------------------------------------
  287. @z macrobegin Linedown nextwindow Linedown prevwindow
  288. *
  289. * 10 bytes Fri  02-22-1991  16:52:39
  290. * 8 bytes Sat  08-24-1991  16:27:03 (TH @z, written by Richard BlackBurn)
  291.  
  292. * 
  293. * ----------------------------------------------------------------------
  294. * ^(e) Copy To Current Window:
  295. *       -   Blocked Line(s) From Previous Window With Block, or
  296. *       -   Lines In Previous Window Marked at Pause, or
  297. *       -   Cursor Line in Previous Window if No Block
  298. * ----------------------------------------------------------------------
  299. * This macro will copy:
  300.  
  301. *       -   Single or multiple lines in either window marked as a block
  302. *           to the next window, or
  303.  
  304. *       -   Lines in the previous window marked at pause to the current
  305. *           window, or
  306.  
  307. *       -   Cursor line in previous window if no block is marked to the
  308. *           current window.
  309.  
  310. * If a block is marked in either window before invoking this macro, the
  311. * block (open or closed before invoking) will be copied to the current
  312. * window.
  313.  
  314. * If a block is not marked in either window before invoking this macro,
  315. * the cursor moves to the previous window after the macro is invoked.
  316. * At the pause cursor to the end of the block to be copied, press
  317. * <enter>, and the block will be copied to the next window.
  318.  
  319. * If the cursor position is not changed up or down at the pause, the
  320. * cursor line in the previous window from which the macro is
  321. * invoked will be copied to the next window.
  322.  
  323. * This macro, used in conjunction with macros @w, @z, ^w and ^z, is
  324. * useful for quickly moving contents from one window to another.
  325.  
  326.  
  327. ^e macrobegin
  328.         prevwindow              * Go to previous window
  329.         gotoblockbeg jtrue OK   * Test if any marked block
  330.         markline                * If no block, mark cursor line and
  331.      *    pause                   * cursor to end of block, press <enter>
  332.     OK: copy nextwindow paste   * Paste marked block in unmarked window
  333. *
  334. * 14 bytes Sat  05-09-1992  15:38:48 (TH ^e)
  335.  
  336. * 
  337. * ----------------------------------------------------------------------
  338. * ^(x) Copy To Next Window:
  339. *       -   Blocked Line(s) From Window With Block, or
  340. *       -   Lines In Current Window Marked at Pause, or
  341. *       -   Cursor Line in Current Window if No Block
  342. * ----------------------------------------------------------------------
  343. * This macro will copy:
  344.  
  345. *       -   Single or multiple lines in either window marked as a block
  346. *           to the next window, or
  347.  
  348. *       -   Lines in the current window marked at pause to the next
  349. *           window, or
  350.  
  351. *       -   Cursor line in current window if no block is marked to the
  352. *           next window.
  353.  
  354. * If a block is marked in either window before invoking this macro, the
  355. * block (open or closed before invoking) will be copied to the next
  356. * window.
  357.  
  358. * If a block is not marked in either window before invoking this
  359. * macro, the cursor remains in the window in which the macro is
  360. * invoked.  At the pause cursor to the end of the block to be copied,
  361. * press <enter>, and the block will be copied to the next window.
  362.  
  363. * If the cursor position is not changed up or down at the pause, the
  364. * cursor line in the window in which the macro is invoked will be
  365. * copied to the next window.
  366.  
  367. * This macro, used in conjunction with macros @w, @z, ^w and ^z, is
  368. * useful for quickly moving contents from one window to another.
  369.  
  370. ^x macrobegin
  371.         nextwindow              * Go to next window, closes block if open
  372.         prevwindow              * Return to starting window
  373.         gotoblockbeg jtrue OK   * Test if any marked block
  374.         markline                * If no block, mark cursor line and
  375.      *    pause                   * cursor to end of block, press <enter>
  376.     OK: copy nextwindow paste   * Paste marked block in unmarked window
  377. *
  378. * 15 bytes Sat  05-09-1992  12:07:42 (TH ^x)
  379.  
  380. * 
  381. * ------------------------------------------------------------------
  382. * #(f4__)  Position Cursor In Column At Top of Paragraph (R. Blackburn)
  383. * ------------------------------------------------------------------
  384. #f4 macrobegin
  385.             MarkCharacter   * save our place
  386.             PrevPara        * goto start of paragraph
  387.             MarkCharacter   * make it a block
  388.             GotoBlockEnd    * go back to our place
  389.             MarkLine        * and convert to line block
  390.                             * this is because
  391.             GotoBlockBeg    * block begin on a line block is
  392.                             * just the top of the block
  393.                             * at whatever block you are in
  394.             UnMarkBlock     * un mark the block
  395. *
  396. * 11 bytes Thu  03-21-1991  19:23:29
  397.  
  398. * 
  399. * ------------------------------------------------------------------
  400. * #(f5__)  Position Cursor In Column At Top of Paragraph
  401. * ------------------------------------------------------------------
  402. * Here's an alternate version shortening Richard Blackburn's ^f5 one
  403. * byte.  Except for screen position, both do the same thing.  Richard
  404. * had the neat idea that got me thinking!
  405.  
  406. #f5 Macrobegin
  407.           MarkLine          * save our place
  408.           PrevPara          * goto start of paragraph
  409.           MarkLine          * make it a block
  410.           PrevPosition      * go back to where we started
  411.           GotoBlockBeg      * block begin on a line block is
  412.                             * just the top of the block
  413.                             * at whatever block you are in
  414.           UnMarkBlock       * un mark the block
  415. *
  416. * 10 bytes Thu  03-21-1991  19:23:40
  417.  
  418. * 
  419. * ------------------------------------------------------------------
  420. * #(f6__)  Position Cursor In Column At Bottom of Paragraph
  421. * ------------------------------------------------------------------
  422. #f6 Macrobegin
  423.           MarkLine          * save our place
  424.           EndPara           * goto end of paragraph
  425.           MarkLine          * make it a block
  426.           PrevPosition      * go back to where we started
  427.           GotoBlockEnd      * block end on a line block is
  428.                             * just the bottom of the block
  429.                             * at whatever block you are in
  430.           UnMarkBlock       * un mark the block
  431. *
  432. * 10 bytes Sun  03-24-1991  22:51:35
  433.  
  434. * 
  435. * ----------------------------------------------------------------------
  436. * ^(a_) Moves Cursor To First Character Of Wordleft
  437. * ----------------------------------------------------------------------
  438. ^a  macrobegin
  439.     wordleft                            * Move wordleft
  440.     endline                             * Test if on eol
  441.  jtrue NO_EOL                           * If not on eol, tests true
  442.     wordleft                            * If on eol, goto wordleft
  443.     jump GOTOPOS                        * End macro
  444.  NO_EOL: prevposition                   * If not at eol, return to
  445.  GOTOPOS:                               * where we were
  446. *
  447. * 14 bytes Mon  10-22-1990  11:53:14
  448.  
  449. * 
  450. * ----------------------------------------------------------------------
  451. * ^(f_) Moves Cursor To First Character Of Wordright
  452. * ----------------------------------------------------------------------
  453. ^f macrobegin
  454.     wordright                           * Move wordright
  455.     endline                             * Test if on eol
  456.  jtrue NO_EOL                           * If not on eol, tests true
  457.     wordright                           * If on eol, goto wordright
  458.     jump GOTOPOS                        * End macro
  459.  NO_EOL: prevposition                   * If not at eol, return to
  460.  GOTOPOS:                               * where we were
  461. *
  462. * 14 bytes Mon  10-22-1990  11:53:03
  463.  
  464.  
  465.